#coding=utf-8
import json
from flask import render_template, abort
from jinja2 import TemplateNotFound

from apps.wuliu.models.wuliu import * 
from apps.wuliu.views.root import app

@app.route('/admin/category')
def index():
    try:
        return render_template('wuliu/admin_category/index.html',
            cargo_type_list=json.dumps(CargoType.list_branch()),
            cargo_package_list=json.dumps(CargoPackage.list_branch()),
            cargo_payment_list=json.dumps(CargoPayment.list_branch()),
            trans_type_list=json.dumps(TransType.list_branch()),
            vehicle_type_list=json.dumps(VehicleType.list_branch()),
            vehicle_body_list=json.dumps(VehicleBody.list_branch()), 
        )
    except TemplateNotFound:
        abort(404)
